<template>
  <div class="sidebox">

    <div class="sidebox-header">
      <h4 class="sidebox-title">最热路径</h4>
    </div>
    <div class="sidebox-body course-content side-list-body">

      <a :href="'/paths/detail/?pid='+path.id" v-for="path in hot_paths" :key="path.id">
        <img style="width:25px;height:25px" :src="path.img">
        {{path.title}}
      </a>
    </div>

  </div>
</template>

<script>
  export default {
    name: "HotPaths",
    data() {
      return {
        hot_paths: [
          {
            id: '',
            title: '',
            img: ''
          },
        ] // 最热路径列表
      }
    },
    created() {
      this.get_hot_paths()
    },
    methods:{
      get_hot_paths(){
        this.axios.get('/paths/',{
          params:{
            ordering:'-follow',
            page_size:5
          }
        }).then(res=>{
          this.hot_paths = res.data.results
        })
      }
    }

  }
</script>

<style scoped>

</style>
